package cn.bdqn.controller;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @Author XiaoMo
 * @Date 2022/3/17 10:17
 * @Version 1.0
 */
@RestController
@RequestMapping("/user")
public class UserController {

    @Resource
    RedisTemplate redisTemplate;

    @GetMapping("put/{uname}")
    public String put(@PathVariable String uname){
        redisTemplate.boundValueOps("username").set(uname);
        return "success";
    }

}
